﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Home.Master" AutoEventWireup="true" CodeBehind="TimeDay.aspx.cs" Inherits="TimeWork.TimeDay" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Bredcrumb" runat="server">
    <li><a href="#" class="report">Đăng ký thời gian</a></li>>
    <li><a href="#">Đăng ký theo ngày</a></li>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <form id="timeday" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
    <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate> --%>
            <div class="info-box" style="width:auto;">
                <h3>Đăng ký thời gian theo ngày</h3>
                <table>
                    <tr>
                        <td class="tdLabel" style="width: 115px;"><%--Tên:--%></td>
                        <td align="left" valign="top"  style="width: 415px;"><%--<asp:Label ID="lblName" runat="server"></asp:Label>--%></td>
                        <td align="right" valign="top">Chọn ngày:</td>
                        <td rowspan="5" style="vertical-align: top; width: 250px;" align="center">
                            <asp:Calendar ID="Calendar" runat="server" BackColor="#FFFFCC" 
                                BorderColor="#FFCC66" BorderWidth="1px" DayNameFormat="Shortest" 
                                Font-Names="Verdana" Font-Size="8pt" ForeColor="#663399" Height="200px" 
                                ShowGridLines="True" Width="220px" 
                                onselectionchanged="Calendar_SelectionChanged" FirstDayOfWeek="Monday">
                                <DayHeaderStyle BackColor="#FFCC66" Font-Bold="True" Height="1px" />
                                <NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" />
                                <OtherMonthDayStyle ForeColor="#CC9966" />
                                <SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
                                <SelectorStyle BackColor="#FFCC66" />
                                <TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt" 
                                    ForeColor="#FFFFCC" />
                                <TodayDayStyle BackColor="#FFCC66" ForeColor="White" />
                            </asp:Calendar>
                        </td>
                    </tr>
                    <tr>
                        <td class="tdLabel"><%--Email:--%></td>
                        <td colspan="2" align="left" valign="top"><asp:Label ID="lblEmail" runat="server" 
                                Visible="False"></asp:Label></td>
                    </tr>
                    <tr>
                        <td class="tdLabel">Thời gian đăng ký:</td>
                        <td colspan="2" align="left" valign="top"><asp:Label ID="lblDateRegister" 
                                runat="server" Font-Bold="True" ForeColor="Maroon"></asp:Label></td>
                    </tr>
                    <tr>
                        <td class="tdLabel"><%--Hoàn thành đăng ký:--%></td>
                        <td colspan="2" align="left" valign="top">
                            <%--<asp:CheckBox ID="cbFinishRegister" 
                                runat="server" CausesValidation="False" 
                                oncheckedchanged="cbFinishRegister_CheckedChanged" AutoPostBack="True" />--%> </td>
                    </tr>
                    <tr>
                        <td colspan="3"><br /><br /><br /><br /></td>
                    </tr>
                </table>
                <asp:Panel ID="pnlAction" runat="server">
                    <table width="700px">
                    <tr>
                        <td class="tdLabel" style="width: 110px;">Công việc:</td>
                        <td> 
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server"     >
                                <ContentTemplate>
                                    <asp:DropDownList ID="ddlCode1" runat="server" AutoPostBack="True" 
                                        CssClass="round-border" onselectedindexchanged="ddlCode1_SelectedIndexChanged">
                                    </asp:DropDownList>
                                    <asp:DropDownList ID="ddlCode2" runat="server" AutoPostBack="True" 
                                        CssClass="round-border" onselectedindexchanged="ddlCode2_SelectedIndexChanged">
                                    </asp:DropDownList> 
                                    <asp:DropDownList ID="ddlCode3" runat="server" AutoPostBack="True" 
                                        CssClass="round-border" onselectedindexchanged="ddlCode3_SelectedIndexChanged">
                                    </asp:DropDownList>&nbsp;
                                    <asp:DropDownList ID="ddlCode4" runat="server" CssClass="round-border">
                                    </asp:DropDownList>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td class="tdLabel">Thời gian:</td>
                        <td>
                            <asp:DropDownList ID="ddlHour" runat="server" CssClass="round-border">
                                <asp:ListItem>0</asp:ListItem>
                                <asp:ListItem>1</asp:ListItem>
                                <asp:ListItem>2</asp:ListItem>
                                <asp:ListItem>3</asp:ListItem>
                                <asp:ListItem>4</asp:ListItem>
                                <asp:ListItem>5</asp:ListItem>
                                <asp:ListItem>6</asp:ListItem>
                                <asp:ListItem>7</asp:ListItem>
                                <asp:ListItem>8</asp:ListItem>
                                <asp:ListItem>9</asp:ListItem>
                                <asp:ListItem>10</asp:ListItem>
                                <asp:ListItem>11</asp:ListItem>
                                <asp:ListItem>12</asp:ListItem>
                                <asp:ListItem>13</asp:ListItem>
                                <asp:ListItem>14</asp:ListItem>
                                <asp:ListItem>15</asp:ListItem>
                                <asp:ListItem>16</asp:ListItem>
                                <asp:ListItem>17</asp:ListItem>
                                <asp:ListItem>18</asp:ListItem>
                                <asp:ListItem>19</asp:ListItem>
                                <asp:ListItem>20</asp:ListItem>
                                <asp:ListItem>21</asp:ListItem>
                                <asp:ListItem>22</asp:ListItem>
                                <asp:ListItem>23</asp:ListItem>
                                <asp:ListItem>24</asp:ListItem>
                            </asp:DropDownList> giờ&nbsp;
                            <asp:DropDownList ID="ddlMinute" runat="server" CssClass="round-border">
                                <asp:ListItem>0</asp:ListItem>
                                <asp:ListItem>5</asp:ListItem>
                                <asp:ListItem>10</asp:ListItem>
                                <asp:ListItem>15</asp:ListItem>
                                <asp:ListItem>20</asp:ListItem>
                                <asp:ListItem>25</asp:ListItem>
                                <asp:ListItem>30</asp:ListItem>
                                <asp:ListItem>35</asp:ListItem>
                                <asp:ListItem>40</asp:ListItem>
                                <asp:ListItem>45</asp:ListItem>
                                <asp:ListItem>50</asp:ListItem>
                                <asp:ListItem>55</asp:ListItem>
                            </asp:DropDownList> phút&nbsp;&nbsp;&nbsp;
                            <i>Loại thời gian: </i><asp:DropDownList ID="ddlTypeTime" runat="server" CssClass="round-border"></asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="tdLabel">Ghi chú:</td>
                        <td>
                            <asp:TextBox ID="txtDescription" runat="server" Width="570" TextMode="MultiLine" Rows="3" CssClass="round-border"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="right"><asp:Button ID="btnRegister" runat="server" 
                                Text="Thêm mới" CssClass="mybutton" CausesValidation="False" 
                                onclick="btnRegister_Click" /></td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td align="left"> 
                            <asp:Label ID="lblError" runat="server" Font-Italic="True" ForeColor="Red"></asp:Label></td>
                    </tr>
                </table>
                </asp:Panel>
                <table class="in-border info-box1">
                    <tr>
                        <td align="center" style="width: 866px;">
                        <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                            <ContentTemplate> 
                            <asp:GridView ID="gvRegisterDay" runat="server" AutoGenerateColumns="false" 
                                DataKeyNames="SAID,SATypeTimeID" onrowediting="gvRegisterDay_RowEditing" 
                                onrowcancelingedit="gvRegisterDay_RowCancelingEdit" 
                                onrowdatabound="gvRegisterDay_RowDataBound" 
                                onrowdeleting="gvRegisterDay_RowDeleting" 
                                onrowupdating="gvRegisterDay_RowUpdating" ShowFooter="True">
                                <Columns>
                                    <asp:TemplateField HeaderText="Tên sản phẩm" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91">
                                        <ItemTemplate>
                                            <asp:Label runat="server" ID="lblProjectName" Text='<%# Eval("ProjectName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Tên công việc" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91">
                                        <ItemTemplate>
                                            <asp:Label runat="server" ID="lblActivityName" Text='<%# Eval("ActivityName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="TG thực tế" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtTimeReport" runat="server" Width="60px"></asp:TextBox>
                                            <asp:MaskedEditExtender InputDirection="LeftToRight" ID="MaskedEditExtender" runat="server" TargetControlID="txtTimeReport" Enabled="True" Mask="99:99" MaskType="Time" UserTimeFormat="TwentyFourHour"/>
                                            <asp:MaskedEditValidator ID="MaskedEditValidator" runat="server"
                                                ControlExtender="MaskedEditExtender" ControlToValidate="txtTimeReport"
                                                ValidationGroup="Register" Display="Dynamic" EmptyValueBlurredText="*" EmptyValueMessage="*"
                                                InvalidValueMessage="*" IsValidEmpty="False" TooltipMessage="*" CssClass="fail" />
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label runat="server" ID="lblTimeReportHour" Text='<%# Eval("SAReportTimeHour") %>'></asp:Label>:<asp:Label runat="server" ID="lblTimeReportMinute" Text='<%# Eval("SAReportTimeMinute") %>'></asp:Label> h
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:Label ID="lblSum" runat="server" Font-Bold="True" ForeColor="#990000"></asp:Label>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Loại thời gian" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91" ItemStyle-HorizontalAlign="Left">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="ddlTypeTimeName" runat="server">
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label runat="server" ID="lblTypeTimeName" Text='<%# Eval("TypeTimeName") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Ghi chú" HeaderStyle-HorizontalAlign="Center" HeaderStyle-BackColor="#f3f9ff" HeaderStyle-ForeColor="#375b91">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtDescription" runat="server" Text='<%# Bind("Description") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label runat="server" ID="lblDescription" Text='<%# Eval("Description") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField ShowHeader="False" HeaderStyle-HorizontalAlign="Center">
                                        <EditItemTemplate>
                                            <asp:ImageButton ID="imgUpdate" runat="server"  CommandName="Update" ImageUrl="~/resources/img/icons/update.png"  ToolTip="Cập nhật" CssClass="wrap_input" ValidationGroup="Register"></asp:ImageButton>
                                            <asp:ImageButton ID="imgCancel" runat="server" CommandName="Cancel" ImageUrl="~/resources/img/icons/cancel.png"  ToolTip="Hủy" CssClass="wrap_input" ValidationGroup="Register"></asp:ImageButton>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imgEdit" runat="server" CommandName="Edit" ImageUrl="~/resources/img/icons/page_white_edit.png" ToolTip="Sửa" CssClass="wrap_input" ValidationGroup="Register"></asp:ImageButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField ShowHeader="False" HeaderStyle-HorizontalAlign="Left">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imgDelete" runat="server" CausesValidation="true" CommandName="Delete" ImageUrl="~/resources/img/icons/delete.png"  ToolTip="Xóa" CssClass="wrap_input" OnClientClick="return confirm('Bạn chắc chắn muốn xóa công việc này?');"></asp:ImageButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                        </td>
                    </tr>
                </table>
            </div>
        <%--</ContentTemplate>
    </asp:UpdatePanel>--%>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server">
        <ProgressTemplate>
            <div class="loading">
                Đang xử lý <img src="../resources/img/icons/loading.gif" style="width: 31px; height: 31px" alt="Loading" />
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
 </form>   
</asp:Content>
